package com.ruoyi.web.controller.vantController.teamController;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.system.domain.zhuangxiumain.shopMain.BrandInfo;
import com.ruoyi.system.service.vantservice.teamservice.ApiStrategyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 施工攻略表示层
 *
 * @author zhangshaocong
 */

@Api(value = "施工攻略接口", tags = {"施工攻略接口"})
@RequestMapping("/api/team/strategy")
@RestController
@CrossOrigin
public class ApiStrategyController {

    @Autowired
    private ApiStrategyService strategyService;

    /**
     * 查询施工攻略列表
     * @return
     */
    @ApiResponses({@ApiResponse(code = 200, message = "正常", response = BrandInfo.class)})
    @ApiOperation(value = "查询施工攻略图文列表")
    @GetMapping("/selectStrategyList")
    public AjaxResult selectStrategyList(){
        return AjaxResult.success(strategyService.selectConstructionStrategyList());
    }

    /**
     * 查询施工攻略的视频
     * @return
     */
    @ApiResponses({@ApiResponse(code = 200, message = "正常", response = BrandInfo.class)})
    @ApiOperation(value = "查询施工攻略视频列表")
    @PostMapping("/selectIntroductionVideo")
    public AjaxResult selectIntroductionVideo(){
        return AjaxResult.success(strategyService.selectIntroductionVideoVo());
    }

    /**
     * 查询施工攻略列表
     * @return
     */
    @ApiResponses({@ApiResponse(code = 200, message = "正常", response = BrandInfo.class)})
    @ApiOperation(value = "查询施工攻略原文信息")
    @GetMapping("/selectStrategyDetail/{strategyId}")
    public AjaxResult selectStrategyDetail(@PathVariable(value = "strategyId", required = false) Long strategyId){
        return AjaxResult.success(strategyService.selectStrategyDetail(strategyId));
    }


    /**
     * 查询施工攻略列表
     * @return
     */
    @ApiResponses({@ApiResponse(code = 200, message = "正常", response = BrandInfo.class)})
    @ApiOperation(value = "查询施工攻略原文案例说明列表")
    @GetMapping("/selectStrategyCaseList/{strategyDetailId}")
    public AjaxResult selectStrategyCaseList(@PathVariable(value = "strategyDetailId", required = false) Long strategyDetailId){
        return AjaxResult.success(strategyService.selectStrategyCaseList(strategyDetailId));
    }
}
